﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

public class WolkController:ControllerBase
{
	private bool walking = false;

	private Vector3 dir;

	private float speed;

	void Update(){
		if (walking) {
			Vector3 currentPos = transform.position;
			currentPos += dir * speed * Time.deltaTime;
			transform.position = currentPos;
			Vector3 lookAtPos = currentPos + dir  * (speed+1.0f) * Time.deltaTime;
			transform.LookAt (lookAtPos);
		}
	}

	public void Walk(Vector3 _dir,float _speed)
	{
		walking = true;
		dir = _dir;
		speed = _speed;
	}

	public void Stop(){
		walking = false;
	}

}
